package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.HlsCashflowItemMapper;
import com.bestow.basic.domain.HlsCashflowItem;
import com.bestow.basic.service.IHlsCashflowItemService;

/**
 * 现金流项目Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-07
 */
@Service
public class HlsCashflowItemServiceImpl implements IHlsCashflowItemService 
{
    @Autowired
    private HlsCashflowItemMapper hlsCashflowItemMapper;

    /**
     * 查询现金流项目
     * 
     * @param cfItem 现金流项目主键
     * @return 现金流项目
     */
    @Override
    public HlsCashflowItem selectHlsCashflowItemByCfItem(String cfItem)
    {
        return hlsCashflowItemMapper.selectHlsCashflowItemByCfItem(cfItem);
    }

    /**
     * 查询现金流项目列表
     * 
     * @param hlsCashflowItem 现金流项目
     * @return 现金流项目
     */
    @Override
    public List<HlsCashflowItem> selectHlsCashflowItemList(HlsCashflowItem hlsCashflowItem)
    {
        return hlsCashflowItemMapper.selectHlsCashflowItemList(hlsCashflowItem);
    }

    /**
     * 新增现金流项目
     * 
     * @param hlsCashflowItem 现金流项目
     * @return 结果
     */
    @Override
    public int insertHlsCashflowItem(HlsCashflowItem hlsCashflowItem)
    {
        hlsCashflowItem.setCreateTime(DateUtils.getNowDate());
        return hlsCashflowItemMapper.insertHlsCashflowItem(hlsCashflowItem);
    }

    /**
     * 修改现金流项目
     * 
     * @param hlsCashflowItem 现金流项目
     * @return 结果
     */
    @Override
    public int updateHlsCashflowItem(HlsCashflowItem hlsCashflowItem)
    {
        hlsCashflowItem.setUpdateTime(DateUtils.getNowDate());
        return hlsCashflowItemMapper.updateHlsCashflowItem(hlsCashflowItem);
    }

    /**
     * 批量删除现金流项目
     * 
     * @param cfItems 需要删除的现金流项目主键
     * @return 结果
     */
    @Override
    public int deleteHlsCashflowItemByCfItems(String[] cfItems)
    {
        return hlsCashflowItemMapper.deleteHlsCashflowItemByCfItems(cfItems);
    }

    /**
     * 删除现金流项目信息
     * 
     * @param cfItem 现金流项目主键
     * @return 结果
     */
    @Override
    public int deleteHlsCashflowItemByCfItem(String cfItem)
    {
        return hlsCashflowItemMapper.deleteHlsCashflowItemByCfItem(cfItem);
    }
}
